#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "Motor.h"
#include "Key.h"
uint8_t KeyNum=0;
int8_t speed=0;
int main(void)
{
	OLED_Init();
	Motor_Init();
    Key_Init();	
	Motor_SetSpeed(speed);
	OLED_ShowString(1,1,"speed:");
	while(1)
	{
		KeyNum=Key_GetNum();
		if(KeyNum==1)
		{
			speed+=5;
			if(speed>50)
				speed=-50;
		}
		Motor_SetSpeed(speed);
		OLED_ShowSignedNum(1,7,speed,3);		
	}
}
